\documentclass[a4paper,10pt]{article}
\usepackage{amsmath,amsfonts,amsthm,amssymb,graphicx, url}
\usepackage{listings}
\lstset{language=C}
\lstset{basicstyle=\small}
\newcommand{\bvec}[1]{\boldsymbol{#1}} % vectors in bold instead of with an arrow on top

% Title Page
\title{Assignment series 1 -- Computational Finance}
\author{Florian Speelman \& Jannis Teunissen}
\date{March 8, 2010}

\begin{document}
\maketitle

\section{Black-Scholes \& binomial tree methods}
This small report is about a binomial tree option pricing method and a hedging simulation.
 In both we assume no arbritrage and a risk-neutral world, so that the volatility and interest rate 
are known over a period of time. Unless specified otherwise, all options are European type.
\subsection{Our implementation}
For the binomial tree we have used the parameters given in the slides (Cox, Ross and Rubinstein):
\begin{align*}
 u &= e^{\sigma \sqrt{\delta t}}\\
d &= 1/u\\
a &= e^{r \delta t}\\
p &= (a - d)/(u - d).
\end{align*}

When we ran experiments, we saw that their requirement of a small $\delta t$ is quite essential.
For the binomial tree model to give meaningful reasults, $p$ should not be larger than one, so that
\begin{equation}
 \delta t \leq \frac{\sigma^2}{r^2}.
\label{deltat}
\end{equation}

The binomial tree that we have implemented has a time complexity of $O(n^2)$, with $n$ the
tree depth. This was clearly seen in experiments, see figure \ref{fig:complexity}.
\begin{figure}
\begin{center}
 \includegraphics[width = 12cm]{performance_good.png}
\caption{Runtime scales quadratically with the tree depth
\label{fig:complexity}}
\end{center}
\end{figure}
\subsection{Put-call parity}
When one is short a put option and long a call option, both with time to maturity $T$
and strike price $K$, this is essentially the same as being long a forward contract with
the same parameters. If the stock price at time $T$ is denoted by $S_T$ and the 
continuously compounded interest rate is $r$, then
\begin{equation*}
 c - p = (S_T - K)\cdot e^{-rT}.
\end{equation*}

We ran a test with the following parameters
\begin{align}
K &= 99\nonumber\\
S_0 &= 100\nonumber\\
r &= 0.06\nonumber\\
\sigma &= 0.2\nonumber\\
T &= 1,
\label{parameters}
\end{align}
where $\sigma$ is the volatility. This gave the result
$$p - c = 11.546 - 4.781 = 6.765,$$
which is in agreement with $(S_T - K)\cdot e^{-rT} = 6.765$. Put-call parity was not dependent on the tree's
depth, although the values of the options differ more from the Black-Scholes analytical values for a smaller
tree.
\subsection{Volatility}
When the volatility is changed the difference between the option value from our model and the Black-Scholes analytical value also change,
see figure \ref{fig:vol_good}. We use a constant tree depth of $200$ (thus a constant $\delta t$) so that for a too small volatility
\eqref{deltat} does not hold.
\begin{figure}
\begin{center}
 \includegraphics[width = 12cm]{vol_good.png}
\caption{The difference between the value of a call option from our model and the Black-Scholes value. Parameters are
as in \eqref{parameters} except for the volatility, and the tree depth is 200.
\label{fig:vol_good}}
\end{center}
\end{figure}
\subsection{Hedge parameter}
We ran some experiments to determine the difference between the hedge parameter from the binomial tree and
the analytical value from the Black-Scholes model. We found that the binomial tree always gives a smaller
hedge for a call option, see figure \ref{fig:hedge}.
We were not so suprised by the fact that the behaviour with increasing odd tree-depth is different from that
of increasing even tree-depth, because of the different shape of the tree. But we were quite surprised
to see bumps in them, which occur periodically, and could not find an explanation.
\begin{figure}
\begin{center}
 \includegraphics[width = 12cm]{hedge_good.png}
\caption{Difference between the hedge parameter $\Delta$ as obtained by our model and the analytical value from Black-Scholes.
The difference was always negative for this call option with parameters as in \eqref{parameters}, so the hedge from our model is
smaller. The separate lines show up for either even or odd tree depths, and for the bumps at a depth of $400$ and $1600$ we could not find
an explanation.
\label{fig:hedge}}
\end{center}
\end{figure}

\subsection{American style options}
We tested the value of an American style option for different volatilities.
For call options the value of the American style option is always the same
as the European version, with this model. This can be derived as follows: if early excercise is a viable option, the current price $S$
is higher than $K$. Then $dS-K$ is non-negative, so that backward induction at this position would lead to a value of:
\begin{equation*}
 \frac{1}{a} \cdot\left[p\cdot(uS - K) + (1-p)\cdot(dS - K))\right] = S - K/a,
\end{equation*}
which is greater than $S - K$ for $a > 1$, so that it is never good to excercise early. The same reasoning shows that it often is good
to excercise an American put option early.

Listed below is a table with results for a put option, unspecified parameters are as in \eqref{parameters}.
As expected, an American style put option is worth more than an European style put option.

\begin{center}
\begin{tabular}{l l l}
Volatility & European & American \\ \hline
0.05 & 0.174527 & 0.411857 \\
0.10 & 1.384563 & 1.850318 \\
0.20 & 4.781124 & 5.347763 \\
0.50 & 15.826536&16.474957
\end{tabular}
\end{center}

\subsection{Option value}
With the parameters listed above, we ran some tests on the convergence of the option value. To see how
the volatility affected the results, we did experiments for $\sigma = {0.1,\; 0.2,\; 0.5}$. We noticed
that the bumps mentioned before occur for a smaller tree depth when the volatility is lower.
The convergence is quite slow, and sometimes the difference increased with the tree depth, which does
not really speak for the binomiol tree as an option pricing method.

Although we think the cause of these bumps could be interesting, it would take considerable time and
since the model studied is a simple approximation, we decided to instead spend some time on the derivation
of analytical results.
\begin{figure}
\begin{center}
 \includegraphics[width = 12cm]{tree-vol1val.png}
\caption{Difference between the value of a call option obtained from our model and the Black-Scholes value. Parameters are as in \eqref{parameters}
except for the volatility: $\sigma = 0.1$. The two lines again show up for even and odd tree depths.
\label{fig:vol1val}}
\end{center}
\end{figure}

\begin{figure}
\begin{center}
 \includegraphics[width = 12cm]{tree-vol2val.png}
\caption{Same plot as figure \ref{fig:vol1val} except the volatility, now $\sigma = 0.2$\label{fig:vol2val}}
\end{center}
\end{figure}

\begin{figure}
\begin{center}
 \includegraphics[width = 12cm]{tree-vol5val.png}
\caption{Same plot as figure \ref{fig:vol1val} except the volatility, now $\sigma = 0.5$\label{fig:vol5val}}
\end{center}
\end{figure}

\subsection{Black-Scholes analytical formula\label{anal1}}
The expected value of a call option $c$ with strikeprice $K$ at time $T$ is given by 
\begin{equation}
 c = \exp[-r T] \cdot E\left[(S_T-K)^+\right].
\label{expectc}
\end{equation}
If the natural logarithm of the stock price $S$ is normally distributed with mean $\mu$ and spread $\sigma$, then $S$ is lognormally distributed
with probability density function
\begin{equation}
 f(S, \mu, \sigma) = \left(S \sigma \sqrt{2\pi}\right)^{-1} \exp\left[-\left(\ln S - \mu\right)^2/\left(2\sigma^2\right)\right].
\label{probdens}
\end{equation}
Now consider the following integral
\begin{equation*}
 \int_{a}^{\infty}\exp\left[-\left(\ln x-\mu\right)^2/(2\sigma^2)\right]dx,
\end{equation*}
where $\sigma$ and $a$ are positive. Changing variables to $z = -\ln x$ this becomes
\begin{equation*}
 -\int_{-\ln a}^{-\infty}\exp\left[-\left(z+\mu\right)^2/(2\sigma^2)\right]\exp(-z)dz,
\end{equation*}
which is equal to
\begin{equation*}
\exp\left[\left((\mu+\sigma^2)^2-\mu^2\right)/(2\sigma^2)\right]\int_{-\infty}^{-\ln a}\exp\left[-\left(z+(\mu+\sigma^2)\right)^2/(2\sigma^2)\right].
\end{equation*}
Using the definition of the cumulative standard normal distribution function $N(x)$, this can be written as
\begin{equation}
\exp\left[\mu + \sigma^2/2\right] \sigma\sqrt{2\pi} \cdot N\left(\frac{-\ln a +\mu + \sigma^2}{\sigma}\right).
 \label{logint}
\end{equation}
Also, making the same substitution as before, it is clear that
\begin{equation*}
 \int_{a}^{\infty}x^{-1}\exp\left[-\left(\ln x-\mu\right)^2/(2\sigma^2)\right]dx
=\int_{-\infty}^{-\ln a}\exp\left[-\left(z+\mu\right)^2/(2\sigma^2)\right]dz,
\end{equation*}
which can be written as
\begin{equation}
 \sigma\sqrt{2\pi} \cdot N\left(\frac{-\ln a +\mu}{\sigma}\right).
\label{log2int}
\end{equation}
We can combine formulas \eqref{expectc} and \eqref{probdens} to get the following expression
\begin{equation*}
 c = e^{-r T} \cdot \int_{K}^{\infty} f(S, \mu, \sigma)\cdot(S-K)dS.
\end{equation*}
Using the results from \eqref{logint} and \eqref{log2int} this can be written as
\begin{align*}
 c = 
\exp\left[\mu + \sigma^2/2 - rT\right] &\cdot N\left(\frac{-\ln K +\mu + \sigma^2}{\sigma}\right)\\
&- K e^{-r T} \cdot N\left(\frac{-\ln K +\mu}{\sigma}\right).
\end{align*}
Finally, we assume the relative change in stockprice in a time $\delta t$ is normally distributed with mean $r\delta t$
and standard deviation $\sigma_0 \sqrt{\delta t}$. The natural logarithm of the stockprice is then a generalized Wiener process
\footnote{For a derivation read for example section 11.7 of `Options, Futures, and Other Derivatives, 5th Edition' by John C. Hull.}
with parameters $\sigma = \sigma_0 \sqrt{T}$ and $\mu = \ln S_0 + (r-\sigma_0^2/2)T$. With these, the epxression for the value
of the call option becomes
\begin{equation}
 c = S_0 \cdot N(d_1) - K e^{-r T} \cdot N(d_2),
\label{callvalue}
\end{equation}
where $d_1$ and $d_2$ are given by
\begin{equation}
 d_1 = \frac{\ln(S_0/K) + (r + \sigma_0^2/2)T}{\sigma_0\sqrt{T}},\;\; d_2 = d_1 - \sigma_0\sqrt{T}.
\label{d1d2}
\end{equation}

\section{Hedging simulations}
\subsection{Derivative of call option value to the stock price\label{anal2}}
If one has a portfolio that is long $\Delta$ shares with price $S_0$ and short one call option with value $c$,
the value $V$ of the portfolio should be constant:
$$\frac{\partial V}{\partial S_0} = \frac{\partial}{\partial S_0}(\Delta\cdot S_0 - c) = \Delta - \frac{\partial c}{\partial S_0} = 0.$$
In other words, the hedge is given by $\frac{\partial c}{\partial S_0}$. 
This derivative of \eqref{callvalue} to the current stock price $S_0$ is given by
\begin{equation}
  \frac{\partial c}{\partial S_0} = N(d_1) + S_0\cdot\frac{\partial N(d_1)}{\partial d_1}\frac{\partial d_1}{\partial S_0} 
- K e^{-r T}\cdot\frac{\partial N(d_2)}{\partial d_2}\frac{\partial d_2}{\partial S_0}.
\label{dcds}
\end{equation}
From \eqref{d1d2} it is clear that 
\begin{align*}
 &\frac{\partial d_2}{\partial S_0} = \frac{\partial d_1}{\partial S_0}\\
 &\frac{\partial N(d_2)}{\partial d_2} = c \cdot \exp\left[-d_2^2/2\right]\\
 &= c \cdot\exp\left[-d_1^2/2\right]\cdot\exp\left[\sigma_0\sqrt{T}d_1 - \sigma_0^2 T/2\right]\\
 &= c \cdot\exp\left[-d_1^2/2\right] \cdot(S/K e^{rT}).
\end{align*}
So \eqref{dcds} simplifies to
\begin{equation*}
 \frac{\partial c}{\partial S_0} = N(d_1) + c \cdot\exp\left[d_1^2/2\right]\cdot(S_0 - S_0) = N(d_1),
\end{equation*}
so that
\begin{equation}
 \Delta = N(d_1).
\end{equation}

\subsection{Results}
Now we consider a portfolio short one call option with the same parameters as in \eqref{parameters}. When the stock price has the following dynamics
\begin{equation}
 dS = rSdt + \sigma Sdz,
\end{equation}
then $\ln S$ is a generalized Wiener process with parameters $\sigma = \sigma_0 \sqrt{T}$ and $\mu = \ln S_0 + (r-\sigma_0^2/2)T$.
So we can use the results from section \ref{anal1} and \ref{anal2} to simulate the stock price over time, and at certain intervals adjust
the hedge to the new stock price. When the volatility of the actual stock price is different from the volatility we use to compute the option value,
we see that the risk increases. The risk can be estimated from the standard deviation of the mean portfolio value after one year, and we see that the
mean portfolio value is zero, as it should be.

The simulation is started with the Black-Scholes value of the option as cash, and with every hedge-adjustment
the balance is adjusted with the current value of the stock times the difference in delta. Also
interest is added every timestep. When the option is exercised after a year that value
is added too, to give the final result.

\begin{figure}
\begin{center}
 \includegraphics[width = 11cm]{hedge_int1.png}
\caption{Standard deviation and mean of the portfolio value of the hedging simulation,
using 500 runs. 
Hedging more often decreases the standard deviation; this is very desirable in the real world
to reduce the risk.
\label{fig:hedge_int1}}
\end{center}
\end{figure}

\begin{figure}
\begin{center}
 \includegraphics[width = 11cm]{hedge_int2.png}
\caption{The same plot as figure \ref{fig:hedge_int1}, only now
the $\sigma_{trade}$ used to trade differs from the $\sigma_0$ used in
the Wiener process representing the stock. Here $\sigma_{trade}=0.20$
and $\sigma_0=0.40$. Here the standard deviation is higher and
improves less when decreasing the timestep.
\label{fig:hedge_int2}}
\end{center}
\end{figure}

\begin{figure}
\begin{center}
 \includegraphics[width = 11cm]{hedge_int3.png}
\caption{The same plot as figure \ref{fig:hedge_int2}, only
$\sigma_{trade}=0.40$ and $\sigma_0 = 0.20$.
\label{fig:hedge_int3}}
\end{center}
\end{figure}

\newpage
\section{Conclusion}
From our experiments we can say that a binomial tree is not a good way to price simple options, because of the slow and weird convergence.
Only for more complicated options,
where Black-Scholes-like formulas are not available anymore, can such a tree become useful.

From our simulation of a portfolio short one call option over time we can see that although the risk can be made small, it is very hard
to reach zero risk. This could be due to the way we implemented the hedge adjustment. But it could also be more fundamental,
due to the $\sqrt{\delta t}$ term in a Wiener process. That term means a stock price has significant fluctuations even on short timescales.

\end{document}
